package com.yu.crm.utils;


import com.whyxzz.netreplyutil.IOnLineStatusNotify;

public class OnLineNotify implements IOnLineStatusNotify {
    /**
     *  判断设备是否在线
     * @param s 序列号
     * @param b 是否在线  true 在线 false 离线
     */
    @Override
    public void onLine(String s, boolean b) {
//        try {
//            //实例化对象
//            CrmDeviceService crmDeviceService = SpringUtils.getBean(CrmDeviceService.class);
//            System.out.println("======判断设备是否在线====="+s+"==========="+b);
//            CrmDevice crmDevice=new CrmDevice();
//            crmDevice.setDeviceMachineCode(s);
//            if(b){
//                crmDevice.setIsTapeOut(1);
//
//            }else{
//                crmDevice.setIsTapeOut(2);
//            }
//            crmDevice.setGmtModified(LocalDateTime.now());
//            crmDeviceService.updateByDeviceMachineCode(crmDevice);
//        }catch (Exception e){
//            e.printStackTrace();
//        }
    }
}
